package es65;

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;

import org.elasticsearch.action.get.GetResponse;
import org.elasticsearch.client.transport.TransportClient;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.transport.TransportAddress;

import com.alibaba.fastjson.JSON;
import com.attilax.net.http.HttpClientUtilV2Saa;

public class es65Demo2 {

	public static void main(String[] args) {
	//	add();
		
		 String url = "http://localhost:9200/index_art/type1/_search?pretty";
		 String r = new HttpClientUtilV2Saa().httpget_autoEncode(url );
			System.out.println(r);

	}

	private static void add() {
		final String url = "http://localhost:9200/index_art/type1";
		Map m = new HashMap() {
			{
				this.put("f", "myfile22");
				this.put("txt", "txt22");
			}
		};
		final String addParams_json = JSON.toJSONString(m);
		String r = new HttpClientUtilV2Saa().httppost(url, addParams_json, "utf8");
		System.out.println(r);
	}

}
